package com.example.listview;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private ListView List_V;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        List_V = (ListView)findViewById(R.id.List_V);
        String [] text = {"第一行","第一行","第一行","第一行","第一行","第一行",
                "第一行","第一行","第一行","第一行","第一行","第一行",
                "第一行","第一行","第一行","第一行","第一行","第一行","第一行","第一行"};
        List<Info> data = new ArrayList<>();
        for (int i = 0;i<20;i++){
            data.add(new Info(text[i]));
        }
        InfoAdapt adapt = new InfoAdapt(this,R.layout.activity_listview,data);
        List_V.setAdapter(adapt);
    }
}
